<?php
class Vs_Encryptor
{
	private static $prefix	= 'Vs_';
	
	public static function password ( $password )
	{
		return md5( self::_getSalt() . $password );
	}
	
	public static function code ()
	{
		return substr(md5(self::_getSalt() . microtime()), 0, 10);
	}
	
	protected static function _getSalt ()
	{
		$salt = getenv('ENCRYPTOR_SALT');		
		if( $salt == false ){
			throw new Vs_Exception( Vs_Exception::UNDEFINED_ENCRYPTOR_SALT );
		}
		return $salt;
	}
	
	
		
}